Xbasic

FILENAME_ENCODE Function

Syntax

Alias_Filename as C = filename_encode(C filename [,C reference_path ])

Arguments

filename

A fully qualified filename with path.

reference_path

Optional. Default = path of current database. A path to use as a starting point in composing the filename alias.

Description

FILENAME_ENCODE() returns a character string after converting a filename to an aliased filename. The value of the FILENAME_DECODE()and FILENAME_ENCODE() functions is that they make it easier to develop an application that is less location dependent. In the following example, "[documents]" is defined as "c:\documents\".

Example

dim cs as C
cs = filename_encode("c:\documents\upgrade.txt")
cs -> "[Documents]upgrade.txt"

See Also